package com.example.net.http


import com.example.net.http.request.AddUserRequest
import com.example.net.http.request.AddUserResponse
import com.example.net.http.response.BaseResponse
import com.example.net.http.response.ChatNewLoginResponse
import com.example.net.http.response.ChatRobotItemResponse
import com.example.net.http.response.ScoreResponse
import okhttp3.RequestBody
import retrofit2.Call
import retrofit2.http.*

/**
 * Author by lp,on 2024年02月14日13:54:14
 * 新版本chat服务的接口
 */
interface ChatNewService {
    @POST("/api/auth/jwt/apiToken")
    suspend fun loginChat(@Body requestBody: RequestBody): ChatNewLoginResponse

    @GET("/robot/refresh")
    suspend fun refreshToken(
        @Header("x-access-token") token: String,
        @Header("x-refresh-token") refreshToken: String
    ): ChatNewLoginResponse?

    @POST("/api/auth/user/add")
    suspend fun createUser(
        @Body requestBody: RequestBody,
        @Header("Authorization") token: String,
        @Header("Content-Type") type: String = "application/json"
    ): AddUserResponse?

    //保存个性化用户机器人
    @POST("/api/llm/userRobot/saveUserRobot")
    suspend fun saveUserRobot(
        @Body requestBody: RequestBody,
        @Header("Authorization") token: String
    ): BaseResponse<ChatRobotItemResponse>

    @POST("/api/llm/userRobotChatRecord/getScoreFromConvLog")
    suspend fun getScore(
        @Body requestBody: RequestBody,
        @Header("Authorization") token: String
    ): BaseResponse<ScoreResponse>

    @POST("/api/asr/realTime")
    fun getAsr(
        @Body pcmFile: RequestBody,
        @Header("Authorization") token: String,
        @Header("Content-Encoding") gzip: String = "gzip",
        @Header("language") language: String = "zh-cn",
        @Header("fast-mode") fast: Int = 1
    ): Call<BaseResponse<String>>


}